#ifndef GAME_H_
#define GAME_H_

#include <vector>
#include <Windows.h>
#include "CTimer.h"

class IGameState;
class CRender;
class CObjectFactory;
class CObjectManager;
class CInputManager;


class Game
{

	HWND m_Hd;
	int m_nScreenHeight;
	int m_nScreenWidth;

	double m_fTimer;
	int m_nFrameCount;
	int m_nFPS;

	bool m_bIsGameLoaded;
	bool m_bShowFPS;

	CTimer *timer;

	CRender* m_pRender;
	CObjectFactory* m_pObjectFactory;
	CObjectManager* m_pObjectManager;
	CInputManager* m_pInputManager;

	std::vector<IGameState*> m_vGameStates;

	Game();
	~Game();
	Game(const Game&);
	Game& operator=(const Game&);

	bool Input(double delta);
	void Update(double delta);
	void Render(int nState);

public:

	static Game* GetInstance();

	void StartUp(HWND hWnd, HINSTANCE hInstance, int nWidth, int nHeight, bool bWindowed);
	void ShutDown();
	bool Main();
	void PopState();
	void PushState(IGameState* pNewState);
	void ClearState();
	void ChangeState(IGameState* pNewState);

	IGameState* GetCurrentState();

	bool GetGameLoaded(){ return m_bIsGameLoaded; }
	
	HWND GetHWND(){ return m_Hd; }

};


#endif